<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>user</title>
    <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">
        function createTable(rowCount, cellCount) {
            var table = $("<table border=\"1\">");
            table.appendTo($("#createtable"));
            for (var i = 0; i < rowCount; i++) {
                var tr = $("<tr></tr>");
                tr.appendTo(table);
                for (var j = 0; j < cellCount; j++) {
                    var td = $("<td>" + i * j + "</td>");
                    td.appendTo(tr);
                }
            }
//            trend.appendTo(table);
            $("#createtable").append("</table>");
        }
    </script>
</head>

<body>
<input type="button" value="添加表格" onClick="createTable(5,6)" >
<input type="button" value="添加行">
<div id="createtable"></div>
<div id="createrow"></div>
</body>
</html>
